var common = {
    init: function () {
        this.backToTop();
    },
    backToTop: function () {
        var $top = $(".backToTop")
        $top.on("click", function () {
            $('body,html').animate({scrollTop: 0}, 500);
        })
    },
    toSome: function (id) {
        var $roleContainer = $("." + id)
        $('body,html').animate({scrollTop: $roleContainer.offset().top + (-56) + "px"}, 500);
    },
    sendRequest: function (url,type,data,successFn,errorFn) {
        $.ajax({
            url: url,
            type: type,
            data: data,
            dataType: 'json',
            success: function (resp) {
                successFn(resp)
            },
            error: function (err) {
                errorFn(err)
            }
        });
    }
}
common.init()